<template>
  <div class="home">
    <!-- 顶部导航栏 -->
    <van-nav-bar title="乐淘云购">
      <van-icon name="search" slot="right" @click="jumpToSearch"/>
    </van-nav-bar>

    <!-- 轮播图插件 -->
    <van-swipe :autoplay="3000" indicator-color="white">
      <van-swipe-item><img src="../assets/images/banner1.png"></van-swipe-item>
      <van-swipe-item><img src="../assets/images/banner2.png"></van-swipe-item>
      <van-swipe-item><img src="../assets/images/banner3.png"></van-swipe-item>
      <van-swipe-item><img src="../assets/images/banner4.png"></van-swipe-item>
      <van-swipe-item><img src="../assets/images/banner5.png"></van-swipe-item>
      <van-swipe-item><img src="../assets/images/banner6.png"></van-swipe-item>
      <van-swipe-item><img src="../assets/images/banner7.png"></van-swipe-item>
      <van-swipe-item><img src="../assets/images/banner8.jpg"></van-swipe-item>
      <van-swipe-item><img src="../assets/images/banner9.png"></van-swipe-item>
    </van-swipe>
    <!-- 鞋子分类 -->
    <div class="shoes_sort">
      <img src="../assets/images/nav1.png">
      <img src="../assets/images/nav2.png">
      <img src="../assets/images/nav3.png">
      <img src="../assets/images/nav4.png">
      <img src="../assets/images/nav5.png">
      <img src="../assets/images/nav6.png">
    </div>
    <!-- 鞋子广告 -->
    <div class="shoes_banner">
      <div class="left">
        <img src="../assets/images/active1.png">
        <img src="../assets/images/active2.png">
        <img src="../assets/images/active4.png">
        <img src="../assets/images/active5.png">
      </div>
      <div class="right">
        <img src="../assets/images/active3.png">
      </div>
    </div>
    <!-- 品牌专区 -->
    <div class="brand">
      <div class="brand_title">
        <img src="../assets/images/title0.png">
      </div>
      <div class="brand_content">
        <img src="../assets/images/brand1.png">
        <img src="../assets/images/brand2.png">
        <img src="../assets/images/brand3.png">
        <img src="../assets/images/brand4.png">
        <img src="../assets/images/brand5.png">
        <img src="../assets/images/brand6.png">
        <img src="../assets/images/brand7.png">
        <img src="../assets/images/brand8.png">
      </div>
    </div>
    <!-- 运动生活专区 -->
    <div class="sports_live">
      <div class="sports_live_title">
        <img src="../assets/images/title1.png">
      </div>
      <div class="sports_live_content" >
        <div class="shop_card" v-for="item in 4" :key="item">
          <img src="../assets/images/product.jpg">
          <div class="text">adidas阿迪达斯 男式 场下休闲篮球鞋S83700 </div>
          <div class="price">
            <span>￥560.00</span>
            <s>￥888.00</s>
          </div>
          <button>立即购买</button>
        </div>
      </div>

      <div class="sports_live_title">
        <img src="../assets/images/title2.png">
      </div>
      <div class="sports_live_content" >
        <div class="shop_card" v-for="item in 4" :key="item">
          <img src="../assets/images/product.jpg">
          <div class="text">adidas阿迪达斯 男式 场下休闲篮球鞋S83700 </div>
          <div class="price">
            <span>￥560.00</span>
            <s>￥888.00</s>
          </div>
          <button>立即购买</button>
        </div>
      </div>

      <div class="sports_live_title">
        <img src="../assets/images/title3.png">
      </div>
      <div class="sports_live_content" >
        <div class="shop_card" v-for="item in 4" :key="item">
          <img src="../assets/images/product.jpg">
          <div class="text">adidas阿迪达斯 男式 场下休闲篮球鞋S83700 </div>
          <div class="price">
            <span>￥560.00</span>
            <s>￥888.00</s>
          </div>
          <button>立即购买</button>
        </div>
      </div>

    </div>

    <!-- 底部标签页 -->
    <van-tabbar v-model="active" active-color="#ff8c00">
      <van-tabbar-item icon="home-o">首页</van-tabbar-item>
      <van-tabbar-item><i slot="icon" class="iconfont icon-caidan1" @click="jumpToCate"></i>分类</van-tabbar-item>
      <van-tabbar-item><i slot="icon" class="iconfont icon-ai-cart"></i>购物车</van-tabbar-item>
      <van-tabbar-item><i slot="icon" class="iconfont icon-huiyuan21" @click="jumpToInfo"></i>会员中心</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  data () {
    return {
      active: 0
    }
  },
  methods: {
    jumpToCate () {
      this.$router.push({ name: 'category' })
    },
    jumpToSearch () {
      this.$router.push({ name: 'search' })
    },
    jumpToInfo () {
      this.$router.push({ name: 'userinfo' })
    }
  }
}
</script>

<style lang="scss" scoped>
  .home {
    img{width: 100%;}
    padding-bottom: 50px;
    //顶部导航
    .van-nav-bar {
      background-color: #006699;
      .van-nav-bar__title {
        color: #fff;
        font-size: 18px;
      }
      .van-icon-search {
        color: #fff;
        font-size: 20px;
        font-weight: 900;
      }
    }
    //鞋子分类
    .shoes_sort{
      img{
        width: 33%;
      }
    }
    //鞋子广告
    .shoes_banner{
      display: flex;
      .left{
        flex: 2;
        img{
          width: 50%;
        }
      }
      .right{
        flex: 1
      }
    }
    //品牌专区
    .brand{
      .brand_content{
        img{
          width: 25%;
        }
      }
    }
    // 运动生活专区
    .sports_live{
      .sports_live_content{
        overflow: hidden;
        padding: 0 5px;
        .shop_card{
          float: left;
          width: 47%;
          box-shadow: 0 0 5px 0px #ccc;
          margin:5px;
          .text{
            font-size: 14px;
            color: #8f8f94;
            padding: 0 10px;
          }
          .price{
            font-size: 12px;
            display: flex;
            justify-content: space-around;
            padding: 0 30px;
            margin: 10px 0;
            span{
              color: red
            }
            s{
              color: #ccc
            }
          }
          button{
            background-color: #006699;
            color:#fff;
            border: none;
            display: block;
            margin: 0 auto;
          }
        }

      }
    }
    //底部标签页
    .van-hairline--top-bottom{
      background-color: #006699;
      .van-tabbar-item{
        color:#fff
      }
    }
  }
</style>
